﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Huant的授权应用</title>
    <link href="~/Content/bootstrap-3.0.3-dist/css/bootstrap.min.css" rel="stylesheet" />
    <script src="~/Content/jquery-easyui-1.3.6/jquery.min.js"></script>
    <style type="text/css">
        body {
            background-color: #eee;
            text-align: center;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#btnLogin').click(function () {
                var userName = $('#txtUserName').val();
                var pwd = $('#txtPwd').val();
                if (userName == '') {
                    alert('请输入用户名');
                    $('#txtUserName').focus();
                    return false;
                }
                if (pwd == '') {
                    alert('请输入密码');
                    $('#txtPwd').focus();
                    return false;
                }
                $.post('/Login/GetUserByNameAndPwd?userName=' + userName + '&pwd=' + pwd,
                    function (data) {
                        if (data == 1) {
                            window.location.href = '/Main';
                        }
                        else {
                            alert('用户名密码错误');
                        }
                    }, 'json');
            })
        })
    </script>
</head>
<body>
    <div>
        <div style="text-align: center; margin: 0 auto; margin-top: 200px; width: 400px" class="jumbotron">
            <h2>用户登录</h2>
            <div style="margin-top: 10px;">
                <input type="text" class="form-control" id="txtUserName" name="txtUserName" placeholder="用户名" value="admin">
            </div>
            <div style="margin-top: 10px;">
                <input type="password" class="form-control" id="txtPwd" name="txtPwd" placeholder="密码" value="123">
            </div>
            <div style="margin-top: 10px;">
                <button type="button" id="btnLogin" name="btnLogin" class="btn btn-primary btn-lg">登&nbsp;&nbsp;&nbsp;&nbsp;陆</button>
            </div>
        </div>
    </div>
</body>
</html>
